//
//  LCZMyselfCell.m
//  
//
//  Created by dllo on 15/11/27.
//
//

#import "LCZMyselfCell.h"

@implementation LCZMyselfCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgrondImageView = [[LCZBaseImageView alloc]initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width , self.contentView.frame.size.height)];
        [self.contentView addSubview:self.backgrondImageView];
        self.backgrondImageView.backgroundColor = [UIColor whiteColor];
        
        CALayer *layer = [self.backgrondImageView layer];
        layer.borderColor = [[UIColor colorWithRed:0.77 green:0.78 blue:0.78 alpha:1] CGColor];
        layer.borderWidth = 0.5f;
        layer.cornerRadius = 10;
        layer.masksToBounds = YES;
        
        
        self.myImage = [[LCZBaseImageView alloc]init];
        [self.contentView addSubview:self.myImage];
        
        self.myLabel = [[LCZBaseLabel alloc]init];
        [self.contentView addSubview:self.myLabel];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
//    [self.myImage mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(self.contentView).with.offset(10);
//        make.top.equalTo(self.contentView).with.offset(10);
//        make.right.equalTo(self.contentView).with.offset(-10);
//        make.height.mas_equalTo(make.width);
//        
//    }];
//    
//    [self.myLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(self.contentView).with.offset(10);
//        make.right.equalTo(self.contentView).with.offset(-10);
//        make.top.equalTo(self.myImage).bottom.with.offset(5);
//        make.bottom.equalTo(self.contentView).width.offset(-10);
//      
//    }];
 
    self.myImage.frame = CGRectMake((self.contentView.frame.size.width - 30) / 2, 10, 30, 30);
    
    self.myLabel.frame = CGRectMake((self.contentView.frame.size.width - 50) / 2, 50, 50, self.contentView.frame.size.height - 60);
    self.myLabel.textAlignment = NSTextAlignmentCenter;
    self.myLabel.font = [UIFont systemFontOfSize:14];
}


@end
